package com.itheima.domain;

import java.util.Objects;

public class Phone {
    private String brand;
    private String price;
    private String color;

    public Phone() {
    }

    public Phone(String brand, String price, String color) {
        this.brand = brand;
        this.price = price;
        this.color = color;
    }

    public void Call(){
       System.out.println("打电话。。。");
    }
    public void  Message(){
        System.out.println("发短信。。。");
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Phone phone = (Phone) o;
        return Objects.equals(brand, phone.brand) && Objects.equals(price, phone.price) && Objects.equals(color, phone.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(brand, price, color);
    }
}
